package com.bmft.signIn;

import com.bmft.signIn.mail.MailWornUtil;
import com.bmft.system.pojo.Student;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import javax.mail.MessagingException;

/**
 * @Author Jarvan
 * @create 2020/9/7 19:13
 */
@SpringBootTest
public class MailUtilTest05 {
    @Autowired
    MailWornUtil mailWornUtil;

    @Test
    public void test() throws MessagingException {

        Student student = new Student();
        student.setName("王二");
        mailWornUtil.sendWornMailToAuthor(student);
    }

    /**
     * 测试异步打卡 成功
     */
    @Test
    public void testAys() throws MessagingException {
        Student student = new Student();
        student.setName("王二");
        mailWornUtil.sendWornMailToAuthor(student);
        try {
            Thread.sleep(10_000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            System.out.println("休眠10 s 等待发送邮件");
        }
    }

}
